package br.com.jw.controle.principal;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ScrollView;
import br.com.jw.controle.cliente.ListarCliente;
import br.com.jw.controle.login.Login;
import br.com.jw.controle.login.R;
import br.com.jw.controle.menu.ListarMenu;
import br.com.jw.controle.produto.ListarProduto;
import br.com.jw.controle.usuario.ListarUsuario;
import br.com.jw.controle.venda.ListarVenda;

public class Principal extends Activity{
	Intent intent;
	ScrollView sv;
	Button btClientes,btProdutos,btUsuarios,btVendas,btLogin,btMenus;
	 @Override
	    public void onCreate(Bundle savedInstanceState) {
	        super.onCreate(savedInstanceState);
	        setContentView(R.layout.principal);
	        inicializarComponentes();
	        
	       
	        btClientes.setOnClickListener(new View.OnClickListener() {
				
				public void onClick(View v) {
					intent = new Intent(Principal.this,ListarCliente.class);
					startActivity(intent);
				}
			});
	        btProdutos.setOnClickListener(new View.OnClickListener() {
				
				public void onClick(View v) {
					intent = new Intent(Principal.this,ListarProduto.class);
					startActivity(intent);
					
				}
			});
	        btUsuarios.setOnClickListener(new View.OnClickListener() {
				
				public void onClick(View v) {
					intent = new Intent(Principal.this,ListarUsuario.class);
					startActivity(intent);
					
				}
			});
	       
	        btVendas.setOnClickListener(new View.OnClickListener() {
				
				public void onClick(View v) {
					intent = new Intent(Principal.this,ListarVenda.class);
					startActivity(intent);
					
				}
			});
	        btMenus.setOnClickListener(new View.OnClickListener() {
				
				public void onClick(View v) {
					intent = new Intent(Principal.this,ListarMenu.class);
					startActivity(intent);
					
				}
			});
	        btLogin.setOnClickListener(new View.OnClickListener() {
				
				public void onClick(View v) {
					intent = new Intent(Principal.this,Login.class);
					startActivity(intent);
					
				}
			});
	 }
 	 public void inicializarComponentes(){
 		 sv =(ScrollView) findViewById(R.id.sv);
		 btClientes = (Button) findViewById(R.id.btClientes);
		 btProdutos = (Button) findViewById(R.id.btProdutos);
		 btUsuarios = (Button) findViewById(R.id.btUsuarios);
		 btVendas   = (Button) findViewById(R.id.btVendas);
		 btLogin    = (Button) findViewById(R.id.btLogin);
		 btMenus    = (Button) findViewById(R.id.btMenus);
	 }
}
